import java.util.Scanner;

/**
 * Created with IDEA
 * author:ju bai
 * Date:2021/7/14
 * Time:23:11
 **/
public class Main2 {
    /*
    守形数：一个数的平方的低位部分等于它本身
    判断这个数是否为守形数
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int n = sc.nextInt();
            int m = n * n;
            while (n != 0) {
                if ((n % 10) == (m % 10)) {
                    n = n / 10;
                    m = m / 10;
                } else {
                    break;
                }
            }
            if (n != 0) {
                System.out.println("No!");
            } else {
                System.out.println("Yes!");
            }
        }
    }
}
